IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[cms_sp_SiteAdd]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[cms_sp_SiteAdd]
GO

create procedure [dbo].[cms_sp_SiteAdd]
@Id [int] = null output,
@SiteGroupId int,
@SiteName nvarchar(150),
@CreatedBy int,
@DateCreated datetime,
@LastUpdatedBy int = null,
@DateLastUpdated datetime = null
as

insert into dbo.Sites (SiteGroupId, SiteName, CreatedBy, DateCreated)
values (@SiteGroupId, @SiteName, @CreatedBy, @DateCreated)

set @Id = SCOPE_IDENTITY()

return @Id
GO


